package cn.harry.modular.sys.service.impl;

import cn.harry.modular.sys.mapper.SysDictDetailMapper;
import cn.harry.modular.sys.domain.SysDictDetail;
import cn.harry.modular.sys.enums.StatusEnums;
import cn.harry.modular.sys.service.SysDictDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 数据字典详情
 *
 * @author honghh Date 2020-03-16 09:53:38 Copyright (C) www.tech-harry.cn
 */
@Service
public class SysDictDetailServiceImpl extends
		ServiceImpl<SysDictDetailMapper, SysDictDetail> implements SysDictDetailService {

	@Override
	public List<SysDictDetail> selectDictDataByType(String dictType) {
		return list(new LambdaQueryWrapper<SysDictDetail>()
				.eq(SysDictDetail::getDictType, dictType)
				.eq(SysDictDetail::getStatus, StatusEnums.ENABLE.getKey()));
	}

	@Override
	public List<SysDictDetail> getExportList(SysDictDetail dictDetail) {
		return list(new LambdaQueryWrapper<>(dictDetail));
	}

}